scores $redis->zrevrange (' key ', 0,-1, true);Zrangebyscore, Zrevrangebyscore$redis->zrangebyscore (key, star, end, Array (withscores, limit));Returns all elements of score >= star and score Zcount$redis->zcount (key, star, end);Returns the number of all elements in the Zs
rear $redis->zunionstore (' Zset3′,array ′, ' zset2′ ', Array (' aggregate ' => ')Max ');//' Aggregate ' => ' max ' or ' min ' indicates that the same element is a large value or a small value//zcount the number of elements in an index interval $redis->zcount (' zset1′,3,5);//2 $r
'), array ('aggregat' => 'Max ')); // 'aggregate' => 'Max 'or 'min' indicates that the same element after the union is used to take the Iterator or a small value.
// Zcount counts the number of elements in an index range.$ Redis-> zcount ('zset1', 3,5); // 2$ Redis-> zcount
Reprint: http://fanshuyao.iteye.com/blog/2384074First, Redis:Https://github.com/MicrosoftArchive/redis/releases1, Redis-x64-3.2.100.msi for the installation version2, Redis-x64-3.2.100.zip for compression packageSecond, because I use the installation version, this issue is also the installation version of the problem1, after the installation of the directory2. Th
, ' Withscores ' =>true that contains the index value; ' Limit ' =>array (1, 2), which indicates a maximum of 2 returns, the result is an array (' EF ', 3), array (' GH ', 5))//zunionstore/zinterstore the set of multiple tables/ The intersection is deposited in another table $redis->zunionstore (' Zset3 ', Array (' Zset1 ', ' Zset2 ', ' zset0 ')); Put ' Zset1 ', ' Zset2 ', ' zset0 ' in the same set of ' zset3 '//Other parameters $
value greater than 5 is ranked before, and is greater than 0 in the rear $redis->zunionstore
(' Zset3′,array (' zset1′, ' zset2′ '), Array (' Aggregate ' => ' Max '));//' Aggregate ' => ' max ' or ' min ' indicates that the same element after the set is a large value or a small value Zcount counts the number of elements in an index interval $redis->
; zunionstore ('zset3', array ('zset1', 'zset2'), array ('weight' => array (5, 0 ))); // The weights parameter indicates the weight, which indicates that elements with a union value greater than 5 are ranked first, and those with a value greater than 0 are ranked later.
$ Redis-> zunionstore ('zset3', array ('zset1', 'zset2'), array ('aggregat' => 'Max ')); // 'aggregate' => 'Max 'or 'min' indicates that the same element after the union is used t
value greater than 5 after the sum is in front of the row, greater than 0, after $redis->zunionstore (' Zset3′,array (' Zset1 (' zset2′ '), Array (' aggregate ' = ' max ')),//' aggregate ' = ' max ' or ' min ' indicates that the same element after the set is either a large value or a small value//zcount statistics aIndexThe number of elements in the interval $redis
', 0,-1); With scores $redis->zrevrange (' key ', 0,-1, true);Zrangebyscore, Zrevrangebyscore$redis->zrangebyscore (key, star, end, Array (withscores, limit));Returns all elements of score >= star and score Zcount$redis->zcount (key, star, end);Returns the number of all ele
of score >= star and score
Zcount
$redis->zcount (key, star, end);
Returns the number of all elements in the Zset named key score >= star and score
Zremrangebyscore, Zdeleterangebyscore$redis->zremrangebyscore (' key ', star, end);
Delete all elements of score >= star and score
Zsize, Zcard
Returns the number of al
$redis->zrangebyscore (key, star, end, Array (withscores, limit));Returns all elements of score >= star and score Zcount$redis->zcount (key, star, end);Returns the number of all elements in the Zset named key score >= star and score Zremrangebyscore, Zdeleterangebyscore$redis
$redis->zrangebyscore (key, star, end, Array (withscores, limit));Returns all elements of score >= star and score Zcount$redis->zcount (key, star, end);Returns the number of all elements in the Zset named key score >= star and score Zremrangebyscore, Zdeleterangebyscore$redis
);Zrangebyscore, Zrevrangebyscore$redis->zrangebyscore (key, star, end, Array (withscores, limit));Returns all elements of score >= star and score Zcount$redis->zcount (key, star, end);Returns the number of all elements in the Zset named key score >= star and score Zremrangebyscore, Zdeleterangebyscore$
′ ');$redis-gt;zdelete (' key ', ' val2′ ');$redis-gt;zrange (' key ', 0,-1);Zrevrange (Key, Start, End,withscores): Returns all elements of the index from start to end in Zset with the name key (the element has been sorted score from large to small). Withscores: Whether to output Socre value, default false, no output$redis-gt;zadd (' key ', 0, ' val0′);$
element with a value greater than 5 that represents a set after the first, and a row greater than 0$redis->zunionstore (' Zset3′,array (' zset1′, ' zset2′ '), Array (' aggregate ' = ' max ') ');/' aggregate ' = ' max ' or ' Min ' indicates that the same element after the set is either a large value or a small valueZcount count the number of elements in an index interval$redis->
existing members Redis Zcard command gets the number of members of an ordered set Redis the Zcount command calculates the number of members that specify interval fractions in an ordered set Redis ZINCR To compute the intersection of a given one or more ordered sets and store the result set in the new ordered set key b
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.